package com.edu.orderservice.client;

import com.edu.commonutils.R;
import com.edu.commonutils.user.EduCourseOrder;
import com.edu.orderservice.client.impl.CourseImpl;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @ClassName EduCourseClient
 * @date 2022/9/26 10:47
 * @Version 1.0
 */
@Component
@FeignClient(value = "service-edu",fallback = CourseImpl.class)
public interface EduCourseClient {

    //根据课程id查询课程信息
    @GetMapping("/eduservice/course/getDto/{courseId}")
    @ResponseBody
    public EduCourseOrder getCourseInfoDto(@PathVariable("courseId") String courseId);

    //把购买数加一
    @PostMapping("/eduservice/course/buy/{id}")
    @ResponseBody
    public R buyId(@PathVariable("id") String id);
}
